﻿Option Strict On
Option Explicit On
Option Infer On

Imports System
Imports GenDotNet.Task.Common
Imports <xmlns="http://kadgen.com/tempCode.xsd">

<Flags()> _
Public Enum StandardAttributes
   ' These values must be explicitly set because this is a flagged (bitwise) enumeration
   None = 0
   Serializable = 1
   DataObject = 2
   NoInlining = 4
End Enum

Public Module StandardAttributeExtensions
   <System.Runtime.CompilerServices.Extension()> _
   Public Function Contains(ByVal checkIn As StandardAttributes, ByVal checkFor As StandardAttributes) As Boolean
      Return (checkIn And checkFor) = checkFor
   End Function
End Module

Namespace VB
   Public Module StandardAttributeExtensions
      <System.Runtime.CompilerServices.Extension()> _
         Public Function Output(ByVal attributes As StandardAttributes) As String
         Dim ret = String.Empty
         Dim attAsInt32 As Int32 = attributes
         If attributes.Contains(StandardAttributes.Serializable) Then
            ret &= _
   <code>&lt;<%= StandardAttributes.Serializable.ToString() %>()> _</code>.Value
         End If
         If attributes.Contains(StandardAttributes.NoInlining) Then
            ret &= _
<code>
      &lt;System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)> _</code>.Value
         End If
         Return ret
      End Function
   End Module
End Namespace

Namespace CSharp
   Public Module StandardAttributeExtensions
      <System.Runtime.CompilerServices.Extension()> _
         Public Function Output(ByVal attributes As StandardAttributes) As String
         Dim ret = String.Empty
         Dim attAsInt32 As Int32 = attributes
         If attributes.Contains(StandardAttributes.Serializable) Then
            ret &= _
   <code>[<%= StandardAttributes.Serializable.ToString() %>]</code>.Value
         End If
         If attributes.Contains(StandardAttributes.NoInlining) Then
            ret &= _
   <code>[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]</code>.Value
         End If
         Return ret
      End Function
   End Module
End Namespace